package cn.itcast.user.service;

import cn.itcast.user.mapper.UserMapper;
import cn.itcast.user.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {


    @Autowired(required = false)
    UserMapper userMapper;
    public User queryById(Long id) {
        return userMapper.findById(id);
//        return generateUser(id);

    }

    private User generateUser(Long id) {
        User user = new User();
        user.setId(id);
        user.setAddress("重庆");
        user.setUsername("tristan");
        return user;
    }
}